<?php 
include "includes/comunes.php";
$tabla="servicios";
$condicion=" ServicioId=".$_GET['ser'];
$orden=" order by ServicioId desc ";
$res=cons_sql($tabla,$condicion,$orden);
$reg=mysql_fetch_array($res);
//seteo titulo de la pagina
$titulo=utf8_encode($reg['ServicioNombre']); 
$imagen='<img src="'.RUTAPANEL.''.utf8_encode($reg['ServicioImagen']).'" alt="'.utf8_encode($reg['ServicioNombre']).'">'; 
?>
<head class="no-js">
	<?php include "includes/metas.php";?>
    </head>
    
    <body>

<?php include "includes/nav.php";?>
 <?php include "includes/header.php";?>    
 <?php include "includes/menu.php";?>  
 
<div class="container">
<div class="row"><div class="col-md-12">
<div class="obra-social">
<?php echo $imagen ?>
</div>
</div>
</div>
</div>

<div class="space"></div>
<div class="container">
<div class="row">
<?php
$a=1;
$tabla="subtiposervicios";
$condicion=" SubtipoServicio=".$_GET['ser'];
$orden=" order by subTipoOrden asc ,SubtipoServicio asc limit 0,6";
$res=cons_sql($tabla,$condicion,$orden);
while($reg=mysql_fetch_array($res)):
if($a==4){
  echo '</div><div class="row">';
  $cerrar="</div>";
  $a=1;
  }else
   $a++;
 ?>
<div class="col-md-4 col-sm-4"><div class="sem"><?php echo utf8_encode($reg['SubTipoNombre'])?></div>

<div class="panel-group" id="accordion">
  <div class="panel panel-default">
<?php 
$tablaSmen="subtipodetalles";
$condicionSmen=" SubtTipoDetalleTipo=".$reg['SubTipoId'];
$ordenSmen=" order by SubTipoDetalleId asc ";
$resSub=cons_sql($tablaSmen,$condicionSmen,$ordenSmen);
$i=0;
while($regSub=mysql_fetch_array($resSub)):
		
?>
  
    <div class="panel-heading" style="background: transparent;">
      <h4 class="panel-title " style="color: #2780e3; background: transparent; font-size: 18px; font-family: Source Sans Pro, Calibri, Candara, Arial, sans-serif;">
        <?php if($regSub['SubTipoUrl']==""):?>
		<a data-toggle="collapse" data-parent="#accordion" href="#collapse<?php echo $reg['SubTipoId'].$i?>">
		<?php else:?>
		<a  href="<?php echo $regSub['SubTipoUrl']?>" target="new">
		<?php endif?>
         
		 <?php echo utf8_encode($regSub['SubTipoNombre']);?>
		  
		  
        </a>
      </h4>
    </div>
	
    <div id="collapse<?php echo $reg['SubTipoId'].$i?>" class="panel-collapse collapse">
      <div class="panel-body">
	  <?php 
	  $tabla1="serviciodetalle";
			$condicion1=" ServicioSubTipoDetalle=".$regSub['SubTipoDetalleId'];
			$orden1=" order by ServicioId asc ";
			$resDet=cons_sql($tabla1,$condicion1,$orden1);
			while($regDet=mysql_fetch_array($resDet)):
			if($regDet['ServicioUrl']==""):
			?> <a href="detalleServicio.php?det=<?php echo utf8_encode($regDet['ServicioId'])?>"><?php echo utf8_encode($regDet['ServicioTitulo'])?></a><br>
			<?php else:?>
			<a href="<?php echo utf8_encode($regDet['ServicioUrl'])?>" target="new"><?php echo utf8_encode($regDet['ServicioTitulo'])?></a><br>
			<?php endif?>
		  <?php endwhile; ?>
      </div>
    </div>
	

  
  
  

  
  <a href="detalleServicio.php?det=<?php //echo utf8_encode($regDet['ServicioId'])?>"><?php //echo utf8_encode($regDet['ServicioTitulo'])?></a>
  
  <?php 
  $i++;
  endwhile; ?>
<!--</ul>-->
  </div>
</div>


  
  
	



</div>
<?php 

endwhile ?>


</div>
<?php if($_GET['ser']==1): ?>
<a href="servicios.php?ser=2"><button type="button" class="btn btn-default">Jubilaciones</button></a>
<a href="servicios.php?ser=3"><button type="button" class="btn btn-default">Seguros</button></a>
<?php endif?>

<?php if($_GET['ser']==2): ?>
<a href="servicios.php?ser=1"><button type="button" class="btn btn-default">Obra Social</button></a>
<a href="servicios.php?ser=3"><button type="button" class="btn btn-default">Seguros</button></a>
<?php endif?>

<?php if($_GET['ser']==3): ?>
<a href="servicios.php?ser=1"><button type="button" class="btn btn-default">Obra Social</button></a>
<a href="servicios.php?ser=2"><button type="button" class="btn btn-default">Jubilaciones</button></a>
<?php endif?>
</div>

</div><div class="linea"></div>
<div class="linea"></div>

<?php include "includes/menuInferior.php";?> 

<div class="linea"></div>

<?php include "includes/footer.php";?> 

 <?php include "includes/js.php";?>     
    </body>
</html>
